/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-15 15:33:40
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-15 15:43:06
 */

// 消除   魔法字符串
const TOKEN_KEY = 'itcast_geek_h5'
export function getToken() {
  return JSON.parse(localStorage.getItem(TOKEN_KEY))
}
export function setToken(val) {
  // console.log(val, 88)
  localStorage.setItem(TOKEN_KEY, JSON.stringify(val))
}
export function removeToken() {
  localStorage.removeItem(TOKEN_KEY)
}
export function hasToken() {
  return !!getToken().token // 有值：true
}
